package treeview.unit;

import java.awt.*;

/**
 * Created by Pavel Nikolaev
 */
public final class HorizontalRuleView extends BaseLineView {
    public void fitIntoWidth(Graphics g, int widthToFitInto) {
        FontMetrics fm = g.getFontMetrics();
        myHeight = fm.getHeight();
        myWidth = widthToFitInto;
        myDescent = fm.getDescent();
        myAscent = fm.getAscent();
    }

    public void paint(Graphics g) {
        int rule_y = myY + myHeight/2;
        g.drawLine(myX, rule_y, myX + myWidth, rule_y);
    }
}

